﻿$(function () {
    $('#ut a[rel=infopaneopener]').click(OpenUserInfo);

    prm.add_endRequest(function () {
        $('#ut a[rel=infopaneopener]').click(OpenUserInfo);
    });
});

function OpenUserInfo() {
    var uid = $(this).attr('uid');
    $.ajax({
        type: 'POST',
        url: relRootPath + '/Services/UserServices.asmx/GetUserProfile',
        data: { userId: uid },
        success: function (data, s, x) {
            var r = eval('[' + $(data).text() + ']')[0];
            if (r != null) {
                var uip = $('div#userinfopane');
                var bday = Utility.ParseJsonDate(r.BirthDate);
                r.BirthDate = bday.getFullYear() + "-" + (bday.getMonth() + 1) + "-" + bday.getDate();
                if (r.Gender != null) {
                    r.Gender = r.Gender == '1' ? '男' : '女';
                }
                $.each(r, function (key, value) {

                    uip.find('#u-' + key).html((value != null) ? "<span>" + value + "</span>" : "---");

                });
                OpenJqueryDialog();
            }
        }
    });

    
}